package cn.javass.dp.memento.mymemento;

public class Client {

    public static void main(String[] args) {
        int level = 1;
        int life = 100;
        //创建一个玩家
        Player player =new Player(level, life);
        System.out.println("玩家xuwujing进入游戏!");
        //状态
        player.getState();
        //进行练级
        player.leveling();
        GameSavePage savePage =new GameSavePage();
        //状态
        player.getState();
        System.out.println("玩家xuwujing正在存档...");
        //第一次存档
        savePage.setSm(player.saveStateToMemento());
        System.out.println("玩家xuwujing存档成功!");
        System.out.println("玩家xuwujing挑战新手村的BOSS!");
        boolean flag=player.challengeBOSS();
        if(flag) {
            System.out.println("玩家xuwujing挑战BOSS成功!");
            return;
        }
        System.out.println("玩家xuwujing挑战BOSS失败!游戏结束！开始读取存档...");
        savePage.getSm();
        System.out.println("玩家xuwujing读取存档成功!");
        //进行练级
        player.leveling();
        //状态
        player.getState();
        System.out.println("玩家xuwujing挑战新手村的BOSS!");
        flag=player.challengeBOSS();
        if(flag) {
            System.out.println("玩家xuwujing挑战BOSS成功!");
            return;
        }


    }
}
